package com.zp.collection;

import java.util.Iterator;
import java.util.TreeSet;

public class TreeSetTest {
	public static void main(String[] args){
		
		TreeSet<String> set = new TreeSet<String>(new Mycomparator());
		
		set.add("D");
		set.add("A");
		set.add("B");
		set.add("E");
		set.add("C");
		
		for(Iterator<String> iter = set.iterator();iter.hasNext();){
			String value = iter.next();
			System.out.println(value);
		}
	}
}
